import request from '@/utils/request'
import Qs from 'qs'

export function statUser(query) {
  return request({
    url: '/stat/user',
    method: 'get',
    params: query
  })
}

export function statOrder(query) {
  return request({
    url: '/stat/order',
    method: 'get',
    params: query
  })
}

export function statGoods(query) {
  return request({
    url: '/stat/goods',
    method: 'get',
    params: query
  })
}

export function overview(query) {
  return request({
    url: '/bill/overview',
    method: 'get',
    params: query
  })
}

export function apply(data) {
  return request({
    url: '/bill/apply',
    method: 'post',
    data
  })
}

export function getListWithdraw(query) {
  return request({
    url: '/withdraw/list',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
